
<?php

function getSubCatlogphone($catalogId, $space, $listcatalog) {
    echo ' <ul>';
    foreach ($listcatalog as $key => $listdata) {

        if ($listdata["catalogParent"] == $catalogId) {
            echo ' <li><a href="' . WEB_PATH . '/' . $listdata["catalogLink"] . '.html" title="' . $listdata["catalogName"] . '"> <i class="fa fa-angle-right"></i> ' . $listdata["catalogName"] . '</a>';
            getSubCatlogphone($listdata["catalogId"], $space, $listcatalog);
            echo '</li>';
        }
    }
    echo '</ul>';
    // }
}
?>
<nav id="menu">
    <ul>
        <li><a href="#">Chuyên mục videos</a></li>
        <?php
        $space = "";
        foreach ($listcatalog as $key => $listdata) {
            if ($listdata["catalogParent"] == 0) {
                echo ' <li><a href="' . WEB_PATH . '/' . $listdata["catalogLink"] . '.html" title="' . $listdata["catalogName"] . '"> <i class="fa fa-angle-right"></i> ' . $listdata["catalogName"] . '</a>';
                getSubCatlogphone($listdata["catalogId"], $space, $listcatalog);
                echo '</li>';
            }
        }
        ?> 
    </ul>
</nav>
